package model;

import web.model.Bean;
import web.model.UUID;

/**
 * Credit bean
 * 
 * @author orlin
 */
public class CreditBean extends Bean {

	private UUID album;
	private int index;
	private String role;
	private String tracks;

	public CreditBean() {
		super();
	}

	public CreditBean(UUID album, int index, String role, String tracks) {
		super();
		this.album = album;
		this.index = index;
		this.role = role;
		this.tracks = tracks;
	}

	public CreditBean(UUID album, int index, Credit credit) {
		super();
		this.album = album;
		this.index = index;
		this.role = credit.getRole();
		this.tracks = credit.getTracks();
	}

	public UUID getAlbum() {
		return album;
	}
	public void setAlbum(UUID album) {
		this.album = album;
	}
	public void setAlbum(String album) {
		this.album = new UUID(album);
	}
	public Integer getIndex() {
		return index;
	}
	public void setIndex(Integer index) {
		this.index = index;
	}
	public void setIndex(String index) {
		this.index = Integer.valueOf(index);
	}
	public String getRole() {
		return role;
	}
	public void setRole(String role) {
		this.role = role;
	}
	public String getTracks() {
		return tracks;
	}
	public void setTracks(String tracks) {
		this.tracks = tracks;
	}

	@Override
	public String toString() {
		StringBuffer line = new StringBuffer();
		line.append("Credit [id:");
		line.append(getId());
		line.append(", album:");
		line.append(album);
		line.append(", index:");
		line.append(index);
		line.append(", role:");
		line.append(role);
		line.append(", tracks:");
		line.append(tracks);
		line.append("]");
		return line.toString();
	}
}
